import {
    $request
} from '../../utils/request'


// 获取帖子信息
export const getmyHome = (() => {
    return new Promise((resolve, reject) => {
        $request({
            url:'myhome',
            method:'GET'
        }).then((response) => {
            console.log("获取帖子信息成功", response);
            resolve(response.data)
        }).catch((error) => {
            console.log("获取帖子信息失败", error);
            reject(error)
        })
    })
})

// 删除帖子
export const getDelPost = ((id) => {
    return new Promise((resolve, reject) => {
        $request({
            url:'delpost/'+ id + '/',
            method:'GET'
        }).then((response) => {
            // console.log("删除帖子成功", response);
            resolve(response)
        }).catch((error) => {
            console.log("删除帖子失败", error);
            reject(error)
        })
    })
})